package cn.com.taiji.pos.service.impl;

import cn.com.taiji.pos.entity.MenuFoodItem;
import cn.com.taiji.pos.mapper.MenuFoodItemMapper;
import cn.com.taiji.pos.service.IMenuFoodItemService;
import com.github.dreamyoung.mprelation.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;

/**
 * <p>
 * 菜品(品项)信息 服务实现类
 * </p>
 *
 * @author
 * @since 2021-03-01
 */
@Service
public class MenuFoodItemServiceImpl extends ServiceImpl<MenuFoodItemMapper, MenuFoodItem> implements IMenuFoodItemService {
    @Autowired
    private MenuFoodItemMapper menuFoodItemMapper;


    @Override
    public List<MenuFoodItem> listXMBFood(String barCode, String code) {
        return menuFoodItemMapper.listXMBFood(LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME), barCode, code);
    }

    @Override
    public List<MenuFoodItem> listFood(String mfcCode, String canci) {
        return menuFoodItemMapper.listFood(mfcCode, canci, LocalDateTime.now().toString());
    }

    @Override
    public List<MenuFoodItem> listFoodByCategory(String categoryId, String canci) {
        return menuFoodItemMapper.listFoodByCategory(categoryId, canci, LocalDateTime.now().toString());
    }
}
